package com.example.administrator.videotest2.util;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.administrator.videotest2.R;
import com.example.administrator.videotest2.entity.TextEntity;

import java.util.List;

public class To_playerAdapter extends ArrayAdapter<TextEntity> {

    private int resourceId;

    public To_playerAdapter(Context context, int textViewResourceId, List<TextEntity> objects) {
        super(context, textViewResourceId, objects);
        resourceId = textViewResourceId;
    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        TextEntity item = getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
        TextView btn = view.findViewById(R.id.to_player);
        btn.setText(item.getNum());
        return view;
    }
}